
const {TRADETRUST_ERC721_ADDRESS:CADD,TRADETRUST_ERC721_ABI:CABI,TRADETRUST_ERC721_BIN:CBIN} = require('./compiledContracts/tradeTrustERC721');
const {deploy,send} = require("./compiledContracts");
const logger = require("../utils/logger");

const deployTradeTrustERC721 = async (registryName, registrySymbol) => {
    let parameters = [registryName, registrySymbol]
    return deploy(parameters,CABI,CBIN)
};

const mint = async (address, tokenId) => {
    let parameters = [address, tokenId];
    return send("safeMint(address,uint256)", parameters,CADD,CABI);
}

const ownerOf = async tokenId => {
    return send("ownerOf(uint256)",[tokenId],CADD,CABI, true);
}

module.exports = {
    deployTradeTrustERC721,
    mint,
    ownerOf
}